import { createRouter, createWebHistory } from "vue-router";

export const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      component: () => import('@/views/LoginView.vue')
    },
    {
      path: '/dashboard',
      component: () => import('@/views/DashboardView.vue'),
      children: [
        {
          path: 'user',
          component: () => import('@/views/UserView.vue')
        },
        {
          path: 'user/:userId',
          component: () => import('@/views/UserDetailView.vue')
        },
        {
          path: 'user/input',
          component: () => import('@/views/UserInputView.vue')
        },
        {
          path: 'user/edit/:userId',
          component: () => import('@/views/UserInputView.vue')
        },
        {
          path: 'activity',
          component: () => import('@/views/ActivityView.vue')
        },
        {
          path: 'activity/:activityId',
          component: () => import('@/views/ActivityDetailView.vue')
        },
        {
          path: 'clue',
          component: () => import('@/views/ClueView.vue')
        },
        {
          path: 'clue/:clueId',
          component: () => import('@/views/ClueDetailView.vue')
        },
        {
          path: '/dashboard/customer',
          component: () => import('@/views/CustomerView.vue')
        },
        {
          path: '/dashboard/customer/:customerId',
          component: () => import('@/views/CustomerDetailView.vue')
        },
        {
          path: '/dashboard/tran',
          component: () => import('@/views/TranView.vue')
        },
        {
          path: '/dashboard/tran/:tranId',
          component: () => import('@/views/TranDetailView.vue')
        },
        {
          path: '',
          component: () => import('../views/StatisticsView.vue'),
        },
      ]
    },
  ]
})
